package com.example.zytj.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.ApiOperation;

@RequestMapping("admin")
@RestController
@ApiOperation("管理员接口")
@CrossOrigin//跨域
public class AdminController {
    
    @ApiOperation(value = "后台登录",notes = "管理员登录，因为只有一个账号，所以没有表")
    @GetMapping
    public String login(String name,String pwd){
        System.out.println("账号："+name);
        System.out.println("密码："+pwd);
        if("admin".equals(name)&&"111".equals(pwd)){
            return "success";
        }
        return "用户名或密码错误";
    }
}
